package com.platform.example.entity;

import java.util.Date;

import javax.persistence.*;  

/**
 * 
 *  在one-to-many双向关联中，多的一方为关系维护端，关系维护端负责外键记录的更新 
 *  关系被维护端是没有权力更新外键记录的
  * 人员 	
  * @author 王求卿[wangqiuqing] Tel:18101037995
  * @createDate 2017年9月5日 上午9:06:03
 */
@Entity
@Table(name = "t_person")
public class Person implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 3308374714959773608L;
	private String id;
	private int age;
	private String name;
	private Date birthday;//日期
	private String remark;//备注
	
  
    private Company company;  
	
	public Person() {
		super();
	}
	
	
	
	public Person(String id, int age, String name) {
		super();
		this.id = id;
		this.age = age;
		this.name = name;
	}



	// Property accessors
	@Id
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	@ManyToOne  
    @JoinColumn(name = "company_id",foreignKey = @ForeignKey(name = "fk_company_fc"))
	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

}